<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" href="css/style.css">
	</head>
	<body>
		<div class="container">
			<div class="top-ny">
				<div class="top-con clearfix">

					<div class="logo">
						<img src="img/logo.png" alt="">
					</div>

					<div class="top-con-middle">
						<ul>
							<li id="template4"><a  href="">网站首页</a></li>
						</ul>
					</div>
					<div class="top-con-right">
						<div class="tel">
							0535-60652189
						</div>
						<ul>
							<li><a href=""><img src="img/qq0.png" alt=""></a></li>
							<li><a href=""><img src="img/wb0.png" alt=""></a></li>
							<li><a href=""><img src="img/wx0.png" alt=""></a></li>
							<li><a href=""><img src="img/email0.png" alt=""></a></li>
						</ul>
					</div>
				</div>
			</div>
			<div class="main-ny-cont solution">
				<div class="main-ny-cont-wrap">
					<div class="cont-title">
						<h2></h2>
						<h3>标签：<span></span><i></i></h3>
					</div>
					<div class="cont-article">
					</div>
				</div>
			</div>
			<div class="footer-ny">
				<div class="footer-ny-con">
					<img class="logo-b" src="img/logo-b.png" alt="">
					<div class="footer-ny-con-right">
						<div class="dh-b"><a id="template5"  href=""></a></div>
						<p>Copyright ©2013 创梦网络科技有限责任公司 ‖ 传悦 Chnyoo.cn All Rights Reserved 京ICP备12005221号 </p>
					</div>
				</div>
			</div>
		</div>
	</body>
</html>
<script>
	let contTitle = document.querySelector(".cont-title")
	let contArticle = document.querySelector(".cont-article")
	let http = new XMLHttpRequest();
	let url = window.location.search;
	http.open("get", `http://10.35.164.79:82/article${url}`);
	http.send();
	http.onreadystatechange = function() {
		if (http.readyState === 4) {
			let test = JSON.parse(http.responseText)
			test.forEach(function(item) {
				contTitle.querySelector("h2").innerHTML = item.title;
				contTitle.querySelector("h3 span").innerHTML = item.labels;
				contTitle.querySelector("h3 i").innerHTML = item.date.slice(0, 10);
				contArticle.innerHTML = item.article;
			})
		}
	}
</script>
<script>
	let navUl = document.querySelector(".top-con-middle ul");
	let fnav = document.querySelector(".dh-b")
	let template4 = document.querySelector("#template4");
	let template5 = document.querySelector("#template5");
	let xml = new XMLHttpRequest();
	xml.open("get", "http://10.35.164.79:82/message");
	xml.send();
	xml.onreadystatechange = function() {
		if (xml.readyState === 4) {
			let nav = JSON.parse(xml.responseText);
			nav.forEach(function(item,index) {
				let newItem4 = template4.cloneNode(true);
				let newItem5 = template5.cloneNode(true);
				newItem4.id = "";
				newItem5.id = "";
				newItem4.querySelector("a").innerHTML = item.cn;
				newItem4.querySelector("a").href = `http://10.35.164.79/qyz/${item.link}`;
				if(index===1 || index===4){
					newItem4.querySelector("a").href = `javascript:;`;
				};
				newItem5.innerHTML = item.bnav;
				if(item.cn!==null){
					navUl.appendChild(newItem4);
				}
				fnav.appendChild(newItem5);
			})
		}
	}
</script>
